home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEtransformNoScroll.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  24.8 KB  |  845 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //
  20. //  Creation Date:    May 1, 1997
  21. //  Author:        sw
  22. //
  23. //  Procedure Name:
  24. //    AEtransformNoScroll 
  25. //
  26. //  Description:
  27. //    Creates attribute editor controls in separate files 
  28. //    for the transform Node
  29. //
  30. //  Input Value:
  31. //    nodeName
  32. //
  33. //  Output Value:
  34. //    None
  35. //
  36.  
  37. global string $gTransformLimitsUILUT[];
  38.  
  39. proc string getCurrentTransformLimitsUI()
  40. {
  41.     global string $gTransformLimitsUILUT[];
  42.  
  43.     // get the current parent
  44.     //
  45.     string $currentParent = `setParent -q`;
  46.  
  47.     // look for this parent in the LUT
  48.     //
  49.     int $i;
  50.     for ( $i = 0; $i < size($gTransformLimitsUILUT); $i += 2 ) {
  51.         if ( $currentParent == $gTransformLimitsUILUT[$i] ) {
  52.             return $gTransformLimitsUILUT[$i+1];
  53.         }
  54.     }
  55.     return $currentParent;
  56. }
  57.  
  58. global proc AElimitsLabelNew ( string $nodeAttr )
  59. {
  60.     setUITemplate -pst attributeEditorLimitsTemplate;
  61.     rowLayout -nc 6;
  62.         text -l "";
  63.         text -l "";
  64.         text -l "Min";
  65.         rowLayout -nc 3;
  66.             text -l "";
  67.             text -l "Current";
  68.             text -l "";
  69.         setParent ..;
  70.         text -l "Max";
  71.         text -l "";
  72.     setParent ..;
  73.     setUITemplate -ppt;
  74. }
  75.  
  76.  
  77. global proc AElimitsLabelReplace ( string $nodeAttr )
  78. {
  79.     // empty proc
  80. }
  81.  
  82.  
  83.  
  84. global proc dimLimitField( string $fieldName, string $attr )
  85. {
  86.     int $value = `getAttr $attr`;
  87.     if ($value)
  88.         floatField -e -en 1 $fieldName;
  89.     else
  90.         floatField -e -en 0 $fieldName;
  91. }
  92.  
  93.  
  94. //  Procedure Name:     checkLimitValue
  95. //
  96. //    see what the current settings of min and max are, and swap them 
  97. //    if they are the wrong way around.
  98. //    Also make sure, that the current value is never invalid
  99. //
  100. global proc checkLimitValue (    string $transformType, 
  101.                                 string $axis,
  102.                                 string $nodeName,
  103.                                 int $fromUI,
  104.                                 string $parent )
  105. {
  106.     string $attrMin = $nodeName+".min"+$transformType+$axis+"Limit";
  107.     string $attrMax = $nodeName+".max"+$transformType+$axis+"Limit";
  108.     string $enableMin = $nodeName+".min"+$transformType+$axis+"LimitEnable";
  109.     string $enableMax = $nodeName+".max"+$transformType+$axis+"LimitEnable";
  110.     string $currentAttr;
  111.     switch ($transformType){
  112.         case "Rot":
  113.             $currentAttr = ($nodeName + ".rotate" + $axis);
  114.             $flag = "-r"+tolower($axis);
  115.             $eflag = "-er"+tolower($axis);
  116.             break;
  117.         case "Trans":
  118.             $currentAttr = ($nodeName + ".translate" + $axis);
  119.             $flag = "-t"+tolower($axis);
  120.             $eflag = "-et"+tolower($axis);
  121.             break;
  122.         case "Scale":
  123.             $currentAttr = ($nodeName + ".scale" + $axis);
  124.             $flag = "-s"+tolower($axis);
  125.             $eflag = "-es"+tolower($axis);
  126.             break;
  127.     }
  128.     string $name = ($transformType + "Limit" + $axis);
  129.  
  130.     float $minValue, $maxValue;
  131.     int $enableMinVal, $enableMaxVal;
  132.     if ( $fromUI == 1 ) {
  133.         // get the current UI values
  134.         //
  135.         $minValue = `floatField -q -v ($parent + "|min" + $name + "Field")`;
  136.         $maxValue = `floatField -q -v ($parent + "|max" + $name + "Field")`;
  137.         $enableMinVal = `checkBox -q -v ($parent + "|min" + $name + "CheckBox")`;
  138.         $enableMaxVal = `checkBox -q -v ($parent + "|max" + $name + "CheckBox")`;
  139.     } else {
  140.         // get the current attribute values
  141.         //
  142.         $minValue = `getAttr $attrMin`;
  143.         $maxValue = `getAttr $attrMax`;
  144.         $enableMinVal = `getAttr $enableMin`;
  145.         $enableMaxVal = `getAttr $enableMax`;
  146.     }
  147.     int $fieldStateMin = `floatField -q -en ($parent + "|min" + $name + "Field")`;
  148.     int $fieldStateMax = `floatField -q -en ($parent + "|max" + $name + "Field")`;
  149.  
  150.     // only swap the values if both enable flags are on
  151.     //
  152.     if ($minValue > $maxValue) {
  153.         if ( $enableMinVal == 1 && $enableMaxVal == 1 ) {
  154.             float $tmp = $minValue;
  155.             $minValue = $maxValue;
  156.             $maxValue = $tmp;
  157.         } else if  ( !$fromUI ) {
  158.             // the user tried to set a limit outside the UI
  159.             // (e.g. via setAttr) erroneously;
  160.             // need to get the current UI values which should
  161.             // be correct and use setAttr to get the attributes
  162.             // in the right state;
  163.             // note that $minValue and $maxValue will still
  164.             // be wrong - this is OK - an error will be
  165.             // produced in when the transformLimit command
  166.             // is executed
  167.             //
  168.             setAttr $attrMin `floatField -q -v ($parent + "|min" + $name + "Field")`;
  169.             setAttr $attrMax `floatField -q -v ($parent + "|max" + $name + "Field")`;
  170.         }
  171.         $fromUI = 1;
  172.     }
  173.  
  174.     if ( $fromUI == 1 ) {
  175.         string $command = "transformLimits "
  176.                         + $flag + " " + $minValue + " " + $maxValue + " "
  177.                         + $eflag + " " + $enableMinVal + " " + $enableMaxVal
  178.                         + " " + $nodeName;
  179.         catch(evalEcho($command));
  180.  
  181.         // get the current attribute values
  182.         //
  183.         $minValue = `getAttr $attrMin`;
  184.         $maxValue = `getAttr $attrMax`;
  185.         $enableMinVal = `getAttr $enableMin`;
  186.         $enableMaxVal = `getAttr $enableMax`;
  187.     }
  188.  
  189.     // update the UI
  190.     //
  191.     floatField -e -v $minValue ($parent + "|min" + $name + "Field");
  192.     floatField -e -v $maxValue ($parent + "|max" + $name + "Field");
  193.     checkBox -e -v $enableMinVal ($parent + "|min" + $name + "CheckBox");
  194.     checkBox -e -v $enableMaxVal ($parent + "|max" + $name + "CheckBox");
  195. }
  196.  
  197.  
  198. //  Procedure Name:     AElimitReplace
  199. //    
  200. //    Hooks up all the widgets
  201. //
  202. global proc AElimitsReplace (    string $transformType, 
  203.                                 string $axis,
  204.                                 string $attrMin )
  205. {
  206.     // construct all the necessary attribute names 
  207.     //
  208.     string $tmp[];
  209.     tokenize($attrMin, ".", $tmp);
  210.     string $nodeName = $tmp[0];
  211.  
  212.     string $attrMax = $nodeName+".max"+$transformType+$axis+"Limit";
  213.     string $enableMin = $nodeName+".min"+$transformType+$axis+"LimitEnable";
  214.     string $enableMax = $nodeName+".max"+$transformType+$axis+"LimitEnable";
  215.     string $currentAttr;
  216.     switch ($transformType){
  217.         case "Rot":
  218.             $currentAttr = ($nodeName + ".rotate" + $axis);
  219.             break;
  220.         case "Trans":
  221.             $currentAttr = ($nodeName + ".translate" + $axis);
  222.             break;
  223.         case "Scale":
  224.             $currentAttr = ($nodeName + ".scale" + $axis);
  225.             break;
  226.     }
  227.     string $name = ($transformType + "Limit" + $axis);
  228.     string $currentName = ("current" + $transformType + $axis + "Field");
  229.  
  230.     // build the full path name for the controls
  231.     //
  232.     string $parent = getCurrentTransformLimitsUI();
  233.     string $minButton = ($parent+"|TransformLimitButtonRow|min"+$name+"Button");
  234.     string $maxButton = ($parent+"|TransformLimitButtonRow|max"+$name+"Button");
  235.     string $minCheckBox = ($parent + "|min" + $name + "CheckBox");
  236.     string $maxCheckBox = ($parent + "|max" + $name + "CheckBox");
  237.     string $minField = ($parent + "|min" + $name + "Field");
  238.     string $maxField = ($parent + "|max" + $name + "Field");
  239.  
  240.     // hook up all the controls 
  241.     //
  242.     button -e
  243.         -c ("limitEnter "
  244.             + $transformType + " "
  245.             + $axis + " "
  246.             + $nodeName + " min "
  247.             + $parent)
  248.         $minButton;
  249.     connectControl $currentName $currentAttr;
  250.     button -e
  251.         -c ("limitEnter "
  252.             + $transformType + " "
  253.             + $axis + " "
  254.             + $nodeName + " max "
  255.             + $parent)
  256.         $maxButton;
  257.  
  258.     // define what happens when the ui is used
  259.     //
  260.     checkBox -e
  261.         -cc ("checkLimitValue "
  262.             + $transformType + " "
  263.             + $axis + " "
  264.             + $nodeName + " 1 "
  265.             + $parent)
  266.         $minCheckBox;
  267.     checkBox -e
  268.         -cc ("checkLimitValue "
  269.             + $transformType + " "
  270.             + $axis + " "
  271.             + $nodeName + " 1 "
  272.             + $parent)
  273.         $maxCheckBox;
  274.     floatField -e
  275.         -cc ("checkLimitValue "
  276.             + $transformType + " "
  277.             + $axis + " "
  278.             + $nodeName + " 1 "
  279.             + $parent)
  280.         $minField;
  281.     floatField -e
  282.         -cc ("checkLimitValue "
  283.             + $transformType + " "
  284.             + $axis + " "
  285.             + $nodeName + " 1 "
  286.             + $parent)
  287.         $maxField;
  288.     scriptJob
  289.         -p $minCheckBox -rp
  290.         -ac $enableMin ("dimLimitField "+$minField+" "+$enableMin);
  291.     scriptJob
  292.         -p $maxCheckBox -rp
  293.         -ac $enableMax ("dimLimitField "+$maxField+" "+$enableMax);
  294.     scriptJob
  295.         -p $minField -rp
  296.         -ac $attrMin ("checkLimitValue "
  297.                         + $transformType + " "
  298.                         + $axis + " "
  299.                         + $nodeName + " 0 "
  300.                         + $parent);
  301.     scriptJob
  302.         -p $maxField -rp
  303.         -ac $attrMax ("checkLimitValue "
  304.                         + $transformType + " "
  305.                         + $axis + " "
  306.                         + $nodeName + " 0 "
  307.                         + $parent);
  308.  
  309.     // check the floatFields' initial dim state
  310.     //
  311.     dimLimitField $minField $enableMin;
  312.     dimLimitField $maxField $enableMax;
  313.  
  314.     // see if it is necessary to swap values 
  315.     //
  316.     checkLimitValue $transformType $axis $nodeName 0 $parent;
  317. }
  318.  
  319.  
  320. //  Procedure Name:     AElimitsNew
  321. //
  322. //      This procedure creates the widgets for the limit workflow
  323. //
  324. global proc AElimitsNew (    string $transformType, 
  325.                             string $axis,
  326.                             string $attrMin )
  327. {
  328.     global string $gTransformLimitsUILUT[];
  329.  
  330.     // construct all the necessary attribute names 
  331.     //
  332.     string $tmp[];
  333.     tokenize($attrMin, ".", $tmp);
  334.     string $nodeName = $tmp[0];
  335.  
  336.     string $attrMax = $nodeName+".max"+$transformType+$axis+"Limit";
  337.     string $enableMin = $nodeName+".min"+$transformType+$axis+"LimitEnable";
  338.     string $enableMax = $nodeName+".max"+$transformType+$axis+"LimitEnable";
  339.     string $currentAttr;
  340.     switch ($transformType){
  341.         case "Rot":
  342.             $currentAttr = ($nodeName + ".rotate" + $axis);
  343.             break;
  344.         case "Trans":
  345.             $currentAttr = ($nodeName + ".translate" + $axis);
  346.             break;
  347.         case "Scale":
  348.             $currentAttr = ($nodeName + ".scale" + $axis);
  349.             break;
  350.     }
  351.     string $UIname = ($transformType + " Limit " + $axis);
  352.     string $name = ($transformType + "Limit" + $axis);
  353.     string $currentName = ("current" + $transformType + $axis + "Field");
  354.  
  355.     // build the widgets 
  356.     setUITemplate -pst attributeEditorLimitsTemplate;
  357.  
  358.     int $newUI = size($gTransformLimitsUILUT);
  359.     $gTransformLimitsUILUT[$newUI] = `setParent -q`;
  360.     
  361.     $gTransformLimitsUILUT[$newUI+1] =
  362.         `rowLayout -nc 6 ("LimitRow" + $transformType)`;
  363.         text -l $UIname;
  364.         checkBox -v `getAttr $enableMin` -l "" ( "min" + $name + "CheckBox");
  365.         floatField -pre 2 -v `getAttr $attrMin` ( "min" + $name + "Field");
  366.         rowLayout -nc 3 "TransformLimitButtonRow";
  367.             button -l "<" ( "min" + $name + "Button");
  368.             floatField -precision 2 ( $currentName);
  369.             button -l ">" ( "max" + $name + "Button");
  370.         setParent ..;
  371.         floatField -pre 2 -v `getAttr $attrMax` ( "max" + $name + "Field");
  372.         checkBox -v `getAttr $enableMax` -l "" ( "max" + $name + "CheckBox");
  373.     setParent ..;
  374.  
  375.     setUITemplate -ppt;
  376.  
  377.     // hook up the widgets
  378.     AElimitsReplace $transformType $axis $attrMin;
  379. }
  380.  
  381.  
  382. //  Procedure Name:     limitEnter
  383. //
  384. //    Puts the current transformation value to be the 
  385. //    corresponding limit. Turns limit usage on.
  386. //
  387. global proc limitEnter (string $transformType, 
  388.                         string $axis,
  389.                         string $nodeName,
  390.                         string $minMax,
  391.                         string $parent )
  392. {
  393.     string $attrMin = $nodeName+".min"+$transformType+$axis+"Limit";
  394.     string $attrMax = $nodeName+".max"+$transformType+$axis+"Limit";
  395.     string $enableMin = $nodeName+".min"+$transformType+$axis+"LimitEnable";
  396.     string $enableMax = $nodeName+".max"+$transformType+$axis+"LimitEnable";
  397.     string $currentAttr;
  398.     switch ($transformType){
  399.         case "Rot":
  400.             $currentAttr = ($nodeName + ".rotate" + $axis);
  401.             break;
  402.         case "Trans":
  403.             $currentAttr = ($nodeName + ".translate" + $axis);
  404.             break;
  405.         case "Scale":
  406.             $currentAttr = ($nodeName + ".scale" + $axis);
  407.             break;
  408.     }
  409.     float $curVal = `getAttr $currentAttr`;
  410.     string $name = ($transformType + "Limit" + $axis);
  411.  
  412.     // check whether the right or the left button was hit.
  413.     // Transfer the value to the corresponding side/limit value
  414.     // check whether the value is a real min/max or whether the
  415.     // values have to be swapped.
  416.     //
  417.     // We are careful to set the actual limit attribute value based
  418.     // on the corresponding transform attribute value, rather than
  419.     // using the value returned by floatField -query, since the latter
  420.     // has less precision.
  421.     //
  422.     if ($minMax == "min")
  423.     {
  424.         string $attrMin = $nodeName+".min"+$transformType+$axis+"Limit";
  425.         setAttr $attrMin $curVal;
  426.         floatField -e -v $curVal ($parent + "|min" + $name + "Field");
  427.         checkBox -e -v 1 ($parent + "|min" + $name + "CheckBox");
  428.         checkLimitValue $transformType $axis $nodeName 0 $parent;
  429.     } else {
  430.         string $attrMax = $nodeName+".max"+$transformType+$axis+"Limit";
  431.         setAttr $attrMax $curVal;
  432.         floatField -e -v $curVal ($parent + "|max" + $name + "Field");
  433.         checkBox -e -v 1 ($parent + "|max" + $name + "CheckBox");
  434.         checkLimitValue $transformType $axis $nodeName 0 $parent;
  435.     }
  436. }
  437.  
  438.  
  439. //  Procedure Name:     AEupdateWorldSpacePivots
  440. //
  441. //    updates the widgets, as soon as any transformation value of 
  442. //    the object changes.
  443. //
  444. global proc AEupdateWorldPivots ( string $nodeName )
  445. {
  446.     float $worldRotatePivot[] = `xform -ws -q -rp $nodeName`;
  447.     float $worldScalePivot[] = `xform -ws -q -sp $nodeName`;
  448.  
  449.     floatField -e -v $worldRotatePivot[0] wrpX;
  450.     floatField -e -v $worldRotatePivot[1] wrpY;
  451.     floatField -e -v $worldRotatePivot[2] wrpZ;
  452.  
  453.     floatField -e -v $worldScalePivot[0] wspX;
  454.     floatField -e -v $worldScalePivot[1] wspY;
  455.     floatField -e -v $worldScalePivot[2] wspZ;
  456. }
  457.  
  458.  
  459. //  Procedure Name:     AEworldSpacePivotsReplace
  460. //
  461. //    Hooks up the world space pivot widgets
  462. //
  463. global proc AEworldSpacePivotsReplace ( string $rotatePivot )
  464. {
  465.     string $nodeAttrName[];
  466.     tokenize($rotatePivot, ".", $nodeAttrName);
  467.     string $nodeName = $nodeAttrName[0];
  468.  
  469.     floatField -e -cc ("AEsetWorldPivots "+$nodeName )
  470.         wrpX;
  471.     floatField -e -cc ("AEsetWorldPivots "+$nodeName )
  472.         wrpY;
  473.     floatField -e -cc ("AEsetWorldPivots "+$nodeName )
  474.         wrpZ;
  475.     
  476.     floatField -e -cc ("AEsetWorldPivots "+$nodeName )
  477.         wspX;
  478.     floatField -e -cc ("AEsetWorldPivots "+$nodeName )
  479.         wspY;
  480.     floatField -e -cc ("AEsetWorldPivots "+$nodeName )
  481.         wspZ;
  482.     
  483.     scriptJob -p "wrpX" -rp 
  484.             -attributeChange ($nodeName+".worldMatrix") 
  485.                 ( "AEupdateWorldPivots "+$nodeName );
  486.     scriptJob -p "wrpX" 
  487.             -attributeChange ($nodeName+".translate") 
  488.                 ( "AEupdateWorldPivots "+$nodeName );
  489.     scriptJob -p "wrpX" 
  490.             -attributeChange ($nodeName+".rotatePivotTranslate") 
  491.                 ( "AEupdateWorldPivots "+$nodeName );
  492.     scriptJob -p "wrpX"
  493.             -attributeChange ($nodeName+".rotatePivot") 
  494.                 ( "AEupdateWorldPivots "+$nodeName );
  495.     scriptJob -p "wrpX"
  496.             -attributeChange ($nodeName+".scalePivot") 
  497.                 ( "AEupdateWorldPivots "+$nodeName );
  498.  
  499.     AEupdateWorldPivots $nodeName;
  500. }
  501.  
  502.  
  503. //  Procedure Name:     AEworldSpacePivotsNew
  504. //
  505. //     Creates the widgets to show world space positions of pivots
  506. //
  507. global proc AEworldSpacePivotsNew ( string $rotatePivot )
  508. {
  509.     string $nodeName[];
  510.     tokenize($rotatePivot, ".", $nodeName);
  511.  
  512.     setUITemplate -pst attributeEditorPresetsTemplate;
  513.     
  514.     rowLayout -nc 4 -cat 1 right 0 -cat 2 both 0
  515.         -cat 3 both 0 -cat 4 both 0
  516.         WorldRotatePivotGrp;
  517.         text -l "World Rotate Pivot" WorldRotatePivotText;
  518.         floatField wrpX;
  519.         floatField wrpY;
  520.         floatField wrpZ;
  521.         setParent ..;
  522.     
  523.     rowLayout -nc 4 -cat 1 right 0 -cat 2 both 0
  524.         -cat 3 both 0 -cat 4 both 0
  525.         WorldScalePivotGrp;
  526.         text -l "World Scale Pivot" WorldScalePivotText;
  527.         floatField wspX;
  528.         floatField wspY;
  529.         floatField wspZ;
  530.         setParent ..;
  531.     
  532.     setUITemplate -ppt;
  533.     
  534.     AEworldSpacePivotsReplace $rotatePivot;
  535. }
  536.  
  537.  
  538. //  Procedure Name:     AEsetWorldPivots
  539. //
  540. //    sets the transformation values of the object according to the 
  541. //    entered values in the fields.
  542. //
  543. global proc AEsetWorldPivots ( string $nodeName )
  544. {
  545.  
  546.     float $rpX = `floatField -q -v wrpX`;
  547.     float $rpY = `floatField -q -v wrpY`;
  548.     float $rpZ = `floatField -q -v wrpZ`;
  549.  
  550.     float $spX = `floatField -q -v wspX`;
  551.     float $spY = `floatField -q -v wspY`;
  552.     float $spZ = `floatField -q -v wspZ`;
  553.  
  554.     xform -ws -rp $rpX $rpY $rpZ $nodeName;
  555.     xform -ws -sp $spX $spY $spZ $nodeName;
  556. }
  557.  
  558.  
  559. //  Procedure Name:     AEupdateLocalSpacePivots
  560. //
  561. //    updates the widgets, as soon as any transformation value of 
  562. //    the object changes.
  563. //
  564. global proc AEupdateLocalPivots ( string $nodeName )
  565. {
  566.     float $localRotatePivot[] = `xform -q -rp $nodeName`;
  567.     float $localScalePivot[] = `xform -q -sp $nodeName`;
  568.  
  569.     floatField -e -v $localRotatePivot[0] lrpX;
  570.     floatField -e -v $localRotatePivot[1] lrpY;
  571.     floatField -e -v $localRotatePivot[2] lrpZ;
  572.  
  573.     floatField -e -v $localScalePivot[0] lspX;
  574.     floatField -e -v $localScalePivot[1] lspY;
  575.     floatField -e -v $localScalePivot[2] lspZ;
  576. }
  577.  
  578.  
  579. //  Procedure Name:     AElocalSpacePivotsReplace
  580. //
  581. //    Hooks up the local space pivot widgets
  582. //
  583. global proc AElocalSpacePivotsReplace ( string $rotatePivot )
  584. {
  585.     string $nodeAttrName[];
  586.     tokenize($rotatePivot, ".", $nodeAttrName);
  587.     string $nodeName = $nodeAttrName[0];
  588.  
  589.     floatField -e -cc ("AEsetLocalPivots "+$nodeName )
  590.         lrpX;
  591.     floatField -e -cc ("AEsetLocalPivots "+$nodeName )
  592.         lrpY;
  593.     floatField -e -cc ("AEsetLocalPivots "+$nodeName )
  594.         lrpZ;
  595.     
  596.     floatField -e -cc ("AEsetLocalPivots "+$nodeName )
  597.         lspX;
  598.     floatField -e -cc ("AEsetLocalPivots "+$nodeName )
  599.         lspY;
  600.     floatField -e -cc ("AEsetLocalPivots "+$nodeName )
  601.         lspZ;
  602.     
  603.     scriptJob -p "lrpX" -rp 
  604.             -attributeChange ($nodeName+".matrix") 
  605.                 ( "AEupdateLocalPivots "+$nodeName );
  606.     scriptJob -p "lrpX" 
  607.             -attributeChange ($nodeName+".translate") 
  608.                 ( "AEupdateLocalPivots "+$nodeName );
  609.     scriptJob -p "lrpX" 
  610.             -attributeChange ($nodeName+".rotatePivotTranslate") 
  611.                 ( "AEupdateLocalPivots "+$nodeName );
  612.     scriptJob -p "lrpX"
  613.             -attributeChange ($nodeName+".rotatePivot") 
  614.                 ( "AEupdateLocalPivots "+$nodeName );
  615.     scriptJob -p "lrpX"
  616.             -attributeChange ($nodeName+".scalePivot") 
  617.                 ( "AEupdateLocalPivots "+$nodeName );
  618.  
  619.     AEupdateLocalPivots $nodeName;
  620. }
  621.  
  622.  
  623. //  Procedure Name:     AElocalSpacePivotsNew
  624. //
  625. //     Creates the widgets to show local space positions of pivots
  626. //
  627. global proc AElocalSpacePivotsNew ( string $rotatePivot )
  628. {
  629.     string $nodeName[];
  630.     tokenize($rotatePivot, ".", $nodeName);
  631.  
  632.     setUITemplate -pst attributeEditorPresetsTemplate;
  633.     
  634.     rowLayout -nc 4 -cat 1 right 0 -cat 2 both 0
  635.         -cat 3 both 0 -cat 4 both 0
  636.         LocalRotatePivotGrp;
  637.         text -l "Local Rotate Pivot" LocalRotatePivotText;
  638.         floatField lrpX;
  639.         floatField lrpY;
  640.         floatField lrpZ;
  641.         setParent ..;
  642.     
  643.     rowLayout -nc 4 -cat 1 right 0 -cat 2 both 0
  644.         -cat 3 both 0 -cat 4 both 0
  645.         LocalScalePivotGrp;
  646.         text -l "Local Scale Pivot" LocalScalePivotText;
  647.         floatField lspX;
  648.         floatField lspY;
  649.         floatField lspZ;
  650.         setParent ..;
  651.     
  652.     setUITemplate -ppt;
  653.     
  654.     AElocalSpacePivotsReplace $rotatePivot;
  655. }
  656.  
  657.  
  658. //  Procedure Name:     AEsetLocalPivots
  659. //
  660. //    sets the transformation values of the object according to the 
  661. //    entered values in the fields.
  662. //
  663. global proc AEsetLocalPivots ( string $nodeName )
  664. {
  665.     float $rpX = `floatField -q -v lrpX`;
  666.     float $rpY = `floatField -q -v lrpY`;
  667.     float $rpZ = `floatField -q -v lrpZ`;
  668.  
  669.     float $spX = `floatField -q -v lspX`;
  670.     float $spY = `floatField -q -v lspY`;
  671.     float $spZ = `floatField -q -v lspZ`;
  672.  
  673.     xform -rp $rpX $rpY $rpZ $nodeName;
  674.     xform -sp $spX $spY $spZ $nodeName;
  675. }
  676.  
  677. global proc
  678. AEnewSpecifiedManip (string $specifiedManipLocation)
  679. {
  680.     setUITemplate -pst attributeEditorTemplate;
  681.  
  682.     attrNavigationControlGrp
  683.         -label "Manip History Node"
  684.         -attribute $specifiedManipLocation
  685.         specifiedManipLocationControl;
  686.  
  687.     setUITemplate -ppt;
  688. }
  689.  
  690. global proc
  691. AEreplaceSpecifiedManip (string $specifiedManipLocation)
  692. {
  693.     attrNavigationControlGrp -edit
  694.         -attribute $specifiedManipLocation
  695.         specifiedManipLocationControl;
  696. }
  697.  
  698. //  Procedure Name:     AEtransformNoScroll
  699. //
  700. global proc AEtransformNoScroll ( string $nodeName )
  701. {
  702.     if (`objectType $nodeName` == "joint")
  703.     {
  704.         editorTemplate -suppress "displayRotatePivot";
  705.         editorTemplate -suppress "displayScalePivot";
  706.         editorTemplate -suppress "rotatePivot";
  707.         editorTemplate -suppress "scalePivot";
  708.     } else {
  709.         editorTemplate -beginLayout "Pivots";
  710.             editorTemplate -beginNoOptimize;
  711.             editorTemplate -addControl "displayRotatePivot";
  712.             editorTemplate -addControl "displayScalePivot";
  713.             editorTemplate -endNoOptimize;
  714.             
  715.             editorTemplate -beginLayout "Local Space";
  716.                 editorTemplate -callCustom "AElocalSpacePivotsNew"
  717.                         "AElocalSpacePivotsReplace"
  718.                         "rotatePivot";
  719.             editorTemplate -endLayout;
  720.     
  721.             editorTemplate -beginLayout "World Space" -collapse 0;
  722.                 editorTemplate -callCustom "AEworldSpacePivotsNew"
  723.                         "AEworldSpacePivotsReplace"
  724.                         "rotatePivot";
  725.             editorTemplate -endLayout;
  726.         editorTemplate -endLayout;
  727.     }
  728.  
  729.     editorTemplate -beginLayout "Limit Information";
  730.     editorTemplate -beginLayout "Translate";
  731.         editorTemplate -callCustom "AElimitsLabelNew"
  732.                     "AElimitsLabelReplace"
  733.                     "minTransXLimitEnable";
  734.         editorTemplate -callCustom 
  735.                 ("AElimitsNew \"Trans\" \"X\"")
  736.                 ("AElimitsReplace \"Trans\" \"X\"")
  737.                 "minTransXLimit";
  738.         editorTemplate -callCustom 
  739.                 ("AElimitsNew \"Trans\" \"Y\"")
  740.                 ("AElimitsReplace \"Trans\" \"Y\"")
  741.                 "minTransYLimit";
  742.         editorTemplate -callCustom 
  743.                 ("AElimitsNew \"Trans\" \"Z\"")
  744.                 ("AElimitsReplace \"Trans\" \"Z\"")
  745.                 "minTransZLimit";
  746.     editorTemplate -endLayout;
  747.  
  748.     editorTemplate -beginLayout "Rotate" -collapse 0;
  749.         editorTemplate -callCustom "AElimitsLabelNew"
  750.                     "AElimitsLabelReplace"
  751.                     "minRotXLimitEnable";
  752.         editorTemplate -callCustom 
  753.                 ("AElimitsNew \"Rot\" \"X\"")
  754.                 ("AElimitsReplace \"Rot\" \"X\"")
  755.                 "minRotXLimit";
  756.         editorTemplate -callCustom 
  757.                 ("AElimitsNew \"Rot\" \"Y\"")
  758.                 ("AElimitsReplace \"Rot\" \"Y\"")
  759.                 "minRotYLimit";
  760.         editorTemplate -callCustom 
  761.                 ("AElimitsNew \"Rot\" \"Z\"")
  762.                 ("AElimitsReplace \"Rot\" \"Z\"")
  763.                 "minRotZLimit";
  764.     editorTemplate -endLayout;
  765.  
  766.     editorTemplate -beginLayout "Scale";
  767.         editorTemplate -callCustom "AElimitsLabelNew"
  768.                     "AElimitsLabelReplace"
  769.                     "minScaleXLimitEnable";
  770.         editorTemplate -callCustom 
  771.                 ("AElimitsNew \"Scale\" \"X\"")
  772.                 ("AElimitsReplace \"Scale\" \"X\"")
  773.                 "minScaleXLimit";
  774.         editorTemplate -callCustom 
  775.                 ("AElimitsNew \"Scale\" \"Y\"")
  776.                 ("AElimitsReplace \"Scale\" \"Y\"")
  777.                 "minScaleYLimit";
  778.         editorTemplate -callCustom 
  779.                 ("AElimitsNew \"Scale\" \"Z\"")
  780.                 ("AElimitsReplace \"Scale\" \"Z\"")
  781.                 "minScaleZLimit";
  782.     editorTemplate -endLayout;
  783.     editorTemplate -endLayout;
  784.  
  785.     editorTemplate -beginLayout "Display";
  786.         editorTemplate -beginNoOptimize;
  787.         editorTemplate -addControl "displayHandle";
  788.         editorTemplate -addControl "displayLocalAxis";
  789.         editorTemplate -endNoOptimize;
  790.  
  791.         editorTemplate -l "Selection Handle" -addControl "selectHandle";
  792.         editorTemplate -addControl "showManipDefault";
  793.         editorTemplate -callCustom AEnewSpecifiedManip AEreplaceSpecifiedManip "specifiedManipLocation";
  794.  
  795.         // include/call base class/node attributes
  796.         AEdagNodeCommon $nodeName;
  797.  
  798.     editorTemplate -endLayout;
  799.  
  800.     // include/call base class/node attributes
  801.     AEdagNodeInclude $nodeName;
  802.  
  803.     //suppressed Attributes
  804.     editorTemplate -suppress "minTransLimit";
  805.     editorTemplate -suppress "maxTransLimit";
  806.     editorTemplate -suppress "minRotLimit";
  807.     editorTemplate -suppress "maxRotLimit";
  808.     editorTemplate -suppress "minScaleLimit";
  809.     editorTemplate -suppress "maxScaleLimit";
  810.     editorTemplate -suppress "minTransLimitEnable";
  811.     editorTemplate -suppress "minTransXLimitEnable";
  812.     editorTemplate -suppress "minTransYLimitEnable";
  813.     editorTemplate -suppress "minTransZLimitEnable";
  814.     editorTemplate -suppress "maxTransLimitEnable";
  815.     editorTemplate -suppress "maxTransXLimitEnable";
  816.     editorTemplate -suppress "maxTransYLimitEnable";
  817.     editorTemplate -suppress "maxTransZLimitEnable";
  818.     editorTemplate -suppress "minRotLimitEnable";
  819.     editorTemplate -suppress "minRotXLimitEnable";
  820.     editorTemplate -suppress "minRotYLimitEnable";
  821.     editorTemplate -suppress "minRotZLimitEnable";
  822.     editorTemplate -suppress "maxRotLimitEnable";
  823.     editorTemplate -suppress "maxRotXLimitEnable";
  824.     editorTemplate -suppress "maxRotYLimitEnable";
  825.     editorTemplate -suppress "maxRotZLimitEnable";
  826.     editorTemplate -suppress "minScaleLimitEnable";
  827.     editorTemplate -suppress "minScaleXLimitEnable";
  828.     editorTemplate -suppress "minScaleYLimitEnable";
  829.     editorTemplate -suppress "minScaleZLimitEnable";
  830.     editorTemplate -suppress "maxScaleLimitEnable";
  831.     editorTemplate -suppress "maxScaleXLimitEnable";
  832.     editorTemplate -suppress "maxScaleYLimitEnable";
  833.     editorTemplate -suppress "maxScaleZLimitEnable";
  834.     editorTemplate -suppress "scalePivot";
  835.     editorTemplate -suppress "rotatePivot";
  836.     editorTemplate -suppress "scalePivotTranslate";
  837.     editorTemplate -suppress "rotatePivotTranslate";
  838.     editorTemplate -suppress "newTransMinusRotatePivot";
  839.     editorTemplate -suppress "orient";
  840.     editorTemplate -suppress "geometry";
  841.     editorTemplate -suppress "dynamics";
  842.     editorTemplate -suppress "xformMatrix";
  843. }
  844.  
  845.